package com.example;

import com.alibaba.fastjson.JSONObject;
import org.apache.poi.ss.formula.functions.T;
import org.junit.Test;

import java.security.MessageDigest;

public class TEST {
    public static void main(String[] args) {
//        String encryptStr = "APP_IDabcTIMESTAMP2016-04-12 15:06:06 100TRANS_ID20160412150606100335423B2732427";
//        String result =TEST.encrypt32(encryptStr);
        System.out.println(TEST.getJson());
    }

    public static String encrypt32(String encryptStr) {
        MessageDigest md5;
        try {
            md5 = MessageDigest.getInstance("MD5");
            byte[] md5Bytes = md5.digest(encryptStr.getBytes());
            StringBuffer hexValue = new StringBuffer();
            for (int i = 0; i < md5Bytes.length; i++) {
                int val = ((int) md5Bytes[i]) & 0xff;
                if (val < 16)
                    hexValue.append("0");
                hexValue.append(Integer.toHexString(val));
            }
            encryptStr = hexValue.toString();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return encryptStr;
    }

    public static String  getJson(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("pageNum","0");
        jsonObject.put("size","15");
        jsonObject.put("mouth","201909");
        jsonObject.put("city","0471");
        jsonObject.put("spType","1");
        jsonObject.put("spType","1");
        jsonObject.put("sortName","字段名");
        jsonObject.put("sortOrder","asc");
        jsonObject.put("staffId","");
        jsonObject.put("eparchyCode","");
        return jsonObject.toJSONString();
    }
}
